package aures.ui;

import org.gnome.gdk.Event;
import org.gnome.gtk.Label;
import org.gnome.gtk.Notebook;
import org.gnome.gtk.Widget;
import org.gnome.gtk.Window;

import aures.plugins.sysPlugin;

public class AuresMain extends AuresWin {
	
	final Notebook notebook;
	
	public AuresMain(String src, String root) throws Exception{
		super (src, root);
		this.notebook = (Notebook)getWidget("notebook");
		
        win.connect(new Window.DeleteEvent() {
			@Override
			public boolean onDeleteEvent(Widget arg0, Event arg1) {
				try {
					sysPlugin.cleanPlugins();
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				AuresGui.Quit();
				return false;
			}
        });
	}
	
	public void addPage (AuresPage page){
		notebook.appendPage((Widget)page.getChild(), new Label(page.getTitle()));
	
	}

	public void build (){
		win.setTitle("Aures Poker");
	}
}
